<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Finance\FinanceBillController;
use App\Http\Controllers\Finance\FinanceBranchBillController;
use App\Http\Controllers\Finance\FinanceStopCustomerBillController;
use App\Http\Controllers\Customer\CustomerBillController;
use App\Http\Controllers\Finance\FinanceBillExcelController;

Route::middleware('auth:sanctum')->prefix('finance')->group(function() {
    //客户账单
    Route::post('bill/list',[FinanceBillController::class,'billList']);
    Route::post('bill/detail',[FinanceBillController::class,'billShow']);
    Route::post('bill/update',[FinanceBillController::class,'updateCustomerBill']);
    Route::post('bill/account/update',[FinanceBillController::class,'updateShopSubAccountBill']);

    //客户正式账单导出
    Route::any('bill/export',[FinanceBillExcelController::class,'exportCutomerOfficialBill']);
    Route::any('bill/month/all/export',[FinanceBillExcelController::class,'exportMonthAll']);

    //分部账单
    Route::post('branch/bill/list',[FinanceBranchBillController::class,'branchBillList']);
    Route::post('branch/bill/detail',[FinanceBranchBillController::class,'branchBillDetail']);
    Route::post('branch/bill/update',[FinanceBranchBillController::class,'branchBillUpdate']);
    Route::post('branch/bill/account/update',[FinanceBranchBillController::class,'UpdateBranchBillAccount']);

    //中止客户账单
    Route::post('customer/bill/stop',[FinanceStopCustomerBillController::class,'stopCustomerBill']);

});

//客户端接口
Route::middleware('auth:sanctum')->prefix('customer')->group(function() {
    //客户账单
    Route::post('bill/list',[CustomerBillController::class,'billList']);
    Route::post('bill/detail',[CustomerBillController::class,'billDetail']);

});

